package com.weyoung.common.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 扫墓节点表
 * @TableName grave_visiting_node
 */
@TableName(value ="grave_visiting_node")
@Data
public class GraveVisitingNode implements Serializable {
    /**
     * 扫墓节点主键id，自增长唯一标识记录
     */
    @TableId(type = IdType.AUTO)
    private Integer nodeId;

    /**
     * 关联family表的家族id
     */
    private String familyId;

    /**
     * 关联user表的创建者id
     */
    private Integer creatorId;

    /**
     * 墓主人名称
     */
    private String deceasedName;

    /**
     * 墓主人称呼
     */
    private String deceasedTitle;

    /**
     * 目的位置
     */
    private String location;

    /**
     * 墓地照片URL
     */
    private String photoUrl;

    /**
     * 经度，用于地图定位
     */
    private BigDecimal longitude;

    /**
     * 纬度，用于地图定位
     */
    private BigDecimal latitude;

    /**
     * 创建时间
     */
    private LocalDateTime createDate;

    /**
     * 更新时间
     */
    private LocalDateTime updateDate;

    /**
     * 是否删除，0-未删除，1-已删除
     */
    private Object isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GraveVisitingNode other = (GraveVisitingNode) that;
        return (this.getNodeId() == null ? other.getNodeId() == null : this.getNodeId().equals(other.getNodeId()))
            && (this.getFamilyId() == null ? other.getFamilyId() == null : this.getFamilyId().equals(other.getFamilyId()))
            && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
            && (this.getDeceasedName() == null ? other.getDeceasedName() == null : this.getDeceasedName().equals(other.getDeceasedName()))
            && (this.getDeceasedTitle() == null ? other.getDeceasedTitle() == null : this.getDeceasedTitle().equals(other.getDeceasedTitle()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getPhotoUrl() == null ? other.getPhotoUrl() == null : this.getPhotoUrl().equals(other.getPhotoUrl()))
            && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude()))
            && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNodeId() == null) ? 0 : getNodeId().hashCode());
        result = prime * result + ((getFamilyId() == null) ? 0 : getFamilyId().hashCode());
        result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
        result = prime * result + ((getDeceasedName() == null) ? 0 : getDeceasedName().hashCode());
        result = prime * result + ((getDeceasedTitle() == null) ? 0 : getDeceasedTitle().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getPhotoUrl() == null) ? 0 : getPhotoUrl().hashCode());
        result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
        result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", nodeId=").append(nodeId);
        sb.append(", familyId=").append(familyId);
        sb.append(", creatorId=").append(creatorId);
        sb.append(", deceasedName=").append(deceasedName);
        sb.append(", deceasedTitle=").append(deceasedTitle);
        sb.append(", location=").append(location);
        sb.append(", photoUrl=").append(photoUrl);
        sb.append(", longitude=").append(longitude);
        sb.append(", latitude=").append(latitude);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}